/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#pragma once

#include "OmenConfig.h"
#include "IOmenObject.h"
#include "IOmenMesh.h"
#include "IOmenCollision.h"

namespace Omen
{
    class IScene;

    class OMEN_API IModel : public Omen::IObject, public Omen::ICollidable
    {
      public:
        virtual Omen_GUID classId() const = 0;    /// <summary>Defines the class ID</summary>

        /// Parenting Scene
        virtual void setScene( Omen::IScene* pScene ) = 0;
        virtual Omen::IScene* scene() const = 0;

        /// Meshes
        virtual unsigned long  meshCount() const = 0;
        virtual void addMesh( IMesh* pMesh ) = 0;
        virtual void getMeshes( IMesh** pMeshList, unsigned long& maxSize ) = 0;
        virtual Omen::IMesh* getMesh( unsigned long index ) = 0;

        /// Scale
        virtual void setScale( const Omen::Vector3d& scale ) = 0;
        virtual Omen::Vector3d scale() const = 0;

        /// Transformation
        virtual void setTransformation( const Omen::Matrix4x4& matrix ) = 0;
        virtual Omen::Matrix4x4 const& transformation() const = 0;

        /// Collision detection
        virtual bool testCollision( ICollidable** pListObjects, unsigned long maxNum ) = 0;
        virtual void updateBoundingVolume() = 0;

        virtual const Omen::AABB& boundingBox() const = 0; /// <summary>Returns the axis aligned bounding box of the model</summary>
        virtual const Omen::Sphere& boundingSphere() const = 0; /// <summary>Returns the bounding sphere of the model</summary>

        virtual const Omen::Vector3d& center() = 0; /// <summary>Returns the center point of this model in global 3d coordinate space</summary>

        virtual void setUpdateNeeded( bool bNeeded ) = 0; /// <summary>Omen Model needs to be updated on next frame</summary>
    protected:
    private:
    };
}